//我是控制区域组件
import React from "react";
import { PageHeader, Button ,Modal} from 'antd';
export default class Control extends React.Component {
    handleRes(){
        Modal.confirm({
            content:"您确定要重新开始吗？",
            okText:"确定",
            cancelText:"取消",
            onOk:()=>{
                this.props.onRest()
            }
        })
    }
    handleRegret(){
        this.props.onRegret()
    }
    render() {
        const extr = (
            <div>
                <Button type="primary" style={{marginRight:"10px"}} onClick={this.handleRes.bind(this)}>重新开始</Button>
                <Button onClick={this.handleRegret.bind(this)}>悔棋</Button>
            </div>
        );
        return (
            <div style={{ backgroundColor: '#fff' }}>
                <PageHeader
                    title="五子棋"
                    subTitle="react五子棋"
                    extra={extr}
                >
                </PageHeader>
            </div>
        )
    }
}